target_str = '<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>First Task</title></head><body><style type="text/css">body {height: 100vh;width: 100vw;}</style><div class="left" id="left" style="text-align: center;"><h2><span>This part should be</span><span><i>Left</i></span></h2></div><script type="text/javascript" charset="UTF-8">alert("Hello World");</script></body></html>'

def cut(head, tail, consult):
    head_num = consult.find(head)
    tail_num = consult.find(tail)
    add_num = 0
    if tail == '</head>':
        add_num = 7
    elif tail == '</style>':
        add_num = 8
    elif tail == '</script>':
        add_num = 9
    cut_str = consult[head_num:tail_num+add_num]
    consult = consult.replace(cut_str, '')

    return consult
    

if __name__ == "__main__":
    # start your Python journey
    consult = target_str
    consult = cut('<head>', '</head>', consult)
    consult = cut('<style', '</style>', consult)
    consult = cut('<script type="text/javascript" charset="UTF-8">', '</script>', consult)
    print(consult)